<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-carservice-edit" th:object="${sjCarservice}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">车辆：</label>
                <div class="col-sm-4">
                    <input name="car" class="form-control" th:field="*{car}" type="text" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">派车人：</label>
                <div class="col-sm-4">
                    <input name="dispatchPeople" class="form-control" th:field="*{dispatchPeople}" readonly="readonly" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">驾车方式：</label>
                <div class="col-sm-4">
                    <input name="driverWay" class="form-control" type="text" th:field="*{driverWay}" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">驾车人：</label>
                <div class="col-sm-4">
                    <input name="driver" class="form-control" type="text" th:field="*{driver}" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">申请部门：</label>
                <div class="col-sm-4">
                    <input name="deptName" class="form-control" th:field="*{deptName}" readonly="readonly" type="text" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">目的地：</label>
                <div class="col-sm-4">
                    <input name="address" class="form-control" th:field="*{address}" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">开始时间：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="startAt" class="form-control" th:value="${#dates.format(sjCarservice.startAt, 'yyyy-MM-dd')}" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
                <label class="col-sm-2 control-label is-required">结束时间：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="endAt" class="form-control" th:value="${#dates.format(sjCarservice.endAt, 'yyyy-MM-dd')}" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">内部乘车人：</label>
                <div class="col-sm-4">
                    <input name="people" class="form-control" th:field="*{people}" type="text" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">其他乘车人：</label>
                <div class="col-sm-4">
                    <input name="other" class="form-control" th:field="*{other}" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">公里数：</label>
                <div class="col-sm-4">
                    <input name="gls" class="form-control" th:field="*{gls}" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">用车事由：</label>
                <div class="col-sm-10">
                    <textarea name="descs" class="form-control" required autoComplete="off">[[${sjCarservice.descs}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "sj/carservice";
        $("#form-carservice-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-carservice-edit').serialize());
            }
        }

        $("input[name='startAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>